package com.open.cloud.rbac.utils;

/**
 * 预先约定好的Header Key，用于框架层面传递
 *
 * @author ：sun_bin
 * @date ：Created in 2019/2/25 10:03
 */
public final class PredefinedHeaderKey {

  /**
   * JWT默认Header Key
   */
  public static final String AUTHORIZATION_HEADER = "Authorization";

  /**
   * JWT前缀
   */
  public static final String BEARER_STARTSTR = "Bearer ";

  /**
   * 自定请求源
   */
  public static final String HEADER_ORIGIN="TINY-ORIGIN";

  /**
   * 客户端请求ID，浏览器每次请求时自动生成。每次请求都不相同
   */
  public static final String WEB_REQUEST_ID = "TINY-REQUEST-ID";

  /**
   * 用于在微服务之间传递用户名的头部(兼容孙斌)
   */
  public static final String USERACCOUNT_HEADER = "TINY-AUTH-USERACCOUNT";

  /**
   * 用于在微服务之间传递用户名的头部(兼容权限框架)
   */
  public static final String LOGIN_LOGINNAME = "login_loginname";

  /**
   * 用于在Session中保存用户信息
   */
  public static final String AUTH_USER_INFO = "TINY-AUTH-USERINFO";

  /**
   * 提示会话过期的特殊Header
   */
  public static final String SESSION_TIMEOUT_HEADER = "TINY-AUTH-SESSION-TIMEOUT";

  /**
   * 任务管理传递，长短事务及flowid
   */
  public static final String TX_CONTEXT = "tx-context";

  /**
   * 返回结果包装
   */
  public static final String RESPONSE_WRAPPER_ANN = "RESPONSE-WRAPPER-ANN";
}
